package diona.clipboard;

import diona.dao.SharedFileDao;

import java.awt.image.BufferedImage;

/**
 * User: anton
 * Date: 20.03.11 14:00
 */
public class ImageItem implements ClipboardItem
{
    private final BufferedImage image;

    public ImageItem(BufferedImage image)
    {
        this.image = image;
    }

    public BufferedImage getImage()
    {
        return image;
    }

    public void save(SharedFileDao dao)
    {
        dao.add(image);
    }

    public String getDescription()
    {
        return String.format("Image %dx%d", image.getWidth(), image.getHeight());
    }
}
